<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
	xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
	layout:decorator="layout/default">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>编辑员工</title>
<link rel="stylesheet" th:href="@{/css/bootstrap-switch.min.css}" />
<script type="text/javascript" th:src="@{/js/bootstrap-switch.min.js}"></script>
<script>
	$(document).ready(function() {
		$('input:checkbox').bootstrapSwitch();
	});
</script>
</head>
<body>
	<div layout:fragment="content">
		<form class="form-horizontal" action="" method="POST"
			th:action="@{/employeese/save}" th:object="${employee}">
			<fieldset>
				<legend>编辑员工</legend>
				<input type="hidden" id="action" name="action" value="update" /> <input
					type="hidden" th:field="*{employeeId}" />
				<div class="form-group"
					th:classappend="${#fields.hasErrors('employeeName')} ? 'has-error'">
					<label for="employeeName"
						class="col-lg-2 col-md-2 col-sm-2 hidden-xs control-label">员工姓名</label>
					<div class="col-lg-10 col-md-10 col-sm-10 col-xs-12">
						<input type="text" class="form-control input-sm"
							th:field="*{employeeName}" autofocus="autofocus" /> <small
							class="help-block">员工姓名长度需在4到64位之间</small> <small
							class="text-warning" th:if="${#fields.hasErrors('employeeName')}"
							th:errors="*{employeeName}"></small>
					</div>
				</div>
				<div class="form-group"
					th:classappend="${#fields.hasErrors('phone')} ? 'has-error'">
					<label for="phone"
						class="col-lg-2 col-md-2 col-sm-2 hidden-xs control-label">联系电话</label>
					<div class="col-lg-10 col-md-10 col-sm-10 col-xs-12">
						<input type="text" class="form-control input-sm"
							th:field="*{phone}" maxLength="64" required="required"
							requireText="请输入联系电话" placeHolder="联系电话" /> <small
							class="help-block">联系电话长度需在6到64位之间</small> <small
							class="text-warning" th:if="${#fields.hasErrors('phone')}"
							th:errors="*{phone}"></small>
					</div>
				</div>
				<div class="form-group"
					th:classappend="${#fields.hasErrors('fax')} ? 'has-error'">
					<label for="fax"
						class="col-lg-2 col-md-2 col-sm-2 hidden-xs control-label">传真号码</label>
					<div class="col-lg-10 col-md-10 col-sm-10 col-xs-12">
						<input type="text" class="form-control input-sm" th:field="*{fax}"
							maxLength="64" placeHolder="传真号码" /> <small class="help-block">联系电话长度需在6到64位之间</small>
						<small class="text-warning" th:if="${#fields.hasErrors('fax')}"
							th:errors="*{fax}"></small>
					</div>
				</div>
				<div class="form-group"
					th:classappend="${#fields.hasErrors('email')} ? 'has-error'">
					<label for="email"
						class="col-lg-2 col-md-2 col-sm-2 hidden-xs control-label">电子邮件</label>
					<div class="col-lg-10 col-md-10 col-sm-10 col-xs-12">
						<input type="text" class="form-control input-sm"
							th:field="*{email}" maxLength="64" required="required"
							requireText="请输入电子邮件" placeHolder="电子邮件" /> <small
							class="help-block">邮箱长度不能超过64个字符</small> <small
							class="text-warning" th:if="${#fields.hasErrors('email')}"
							th:errors="*{email}"></small>
					</div>
				</div>
				<div class="form-group"
					th:classappend="${#fields.hasErrors('oracleAccount')} ? 'has-error'">
					<label for="oracleAccount"
						class="col-lg-2 col-md-2 col-sm-2 hidden-xs control-label">Oracle帐号</label>
					<div class="col-lg-10 col-md-10 col-sm-10 col-xs-12">
						<input type="text" class="form-control input-sm"
							th:field="*{oracleAccount}" maxLength="32" placeHolder="Oracle帐号" />
						<small class="help-block">邮箱长度不能超过32个字符</small> <small
							class="text-warning"
							th:if="${#fields.hasErrors('oracleAccount')}"
							th:errors="*{oracleAccount}"></small>
					</div>
				</div>
				<div class="form-group">
					<label for="available"
						class="col-lg-2 col-md-2 col-sm-2 hidden-xs control-label">员工有效</label>
					<div class="col-lg-10 col-md-10 col-sm-10 col-xs-12">
						<div class="bootstrap-switch bootstrap-switch-mini"
							data-on-text="有效" data-off-text="禁用">
							<input type="checkbox" th:field="*{available}" />
						</div>
					</div>
				</div>
				<div class="row">
					<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
						<input type="submit"
							class="col-lg-offset-3 col-md-offset-3 col-lg-5 col-md-4 col-sm-4 btn btn-lg btn-success"
							value="保存数据" /> <input type="reset"
							class="col-lg-offset-1 col-md-offset-1 col-sm-offset-1 btn btn-lg btn-default"
							value="重置" /> <a class="btn btn-lg btn-default" role="button"
							th:href="@{/employees}">返回列表</a>
					</div>
				</div>
			</fieldset>
		</form>
	</div>
</body>
</html>
